﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CPPEI.ETL.DSImplement
{
    class ErrorCode
    {
        private static object s_lockObj = new object();

        private static Hashtable s_comments;

        public const int COM_NoError = 0xFE0001;
        public const int COM_DBError = 0xFE0002;

        public const int DtSerTypeNotFound = 0xFE0003;

        public const int DtSerProxyNotFound = 0xFE0004;

        public const int WS_NotSupport = 0xFE0005;
        public const int COM_Exception = 0xFE0006;

        static void Init()
        {
            if (s_comments != null)
            {
                return;
            }

            lock (s_lockObj)
            {
                if (s_comments != null)
                {
                    return;
                }
                s_comments = new Hashtable();
                s_comments.Add(COM_NoError, "操作成功");
                s_comments.Add(COM_DBError, "数据库错误");
                s_comments.Add(COM_Exception, "出现了异常");
                s_comments.Add(WS_NotSupport, "WebService的结构不支持");
            }
        }

        public static string String(int code)
        {
            Init();
            return ((string)s_comments[code]);
        }
    }
}
